<?php

	/**
	 * CreateTime: 2022/6/2 11:04
	 */

	namespace App\Consts\Approval;

	use App\Service\Approval\ApprovalContract\ApprovalContract;
    use App\Service\Approval\ApprovalContract\ApprovalFwContract;
    use App\Service\Approval\ApprovalContract\ApprovalSealContract;
    use App\Service\Approval\ApprovalCreditClient\ApprovalCreditClient;
    use App\Service\Approval\ApprovalCreditClient\ApprovalCreditClientJoinBlack;
    use App\Service\Approval\ApprovalCreditClient\ApprovalCreditClientRemoveBlack;
    use App\Service\Approval\ApprovalCreditProject\ApprovalCreditProjectCreditManagerReview;
	use App\Service\Approval\ApprovalCreditProject\ApprovalCreditProjectCreditFinanceManagerReview;
	use App\Service\Approval\ApprovalCreditProject\ApprovalCreditProjectCreditDepartmentLeaderReview;
	use	App\Service\Approval\ApprovalCreditProject\ApprovalCreditProjectCreditAmountAjustReviw;
	use App\Tools\DingTalk\DingTalkCallBackFacade;
	use App\Tools\Log\Log;

	class ApprovalSubmitTypeConsts
	{

		// 申请信用客户
		const SUBMIT_CREDIT_CLIENT = 1;
		// 加入黑名单
		const SUBMIT_JOIN_BLACKLIST = 2;
		// 移除黑名单
		const SUBMIT_REMOVE_BLACKLIST = 3;
		// 信用项目申请
		const SUBMIT_CREDIT_PROJECT = 4;
		// 信用客户信用评价更新
		const SUBMIT_CREDIT_CLIENT_EVALUATE_UPDATE = 5;
		// 合同信控送审
		const SUBMIT_CONTRACT_INFORMATION_CONTROLLER = 6;
		// 法务送审
		const SUBMIT_CONTRACT_LAW = 7;
		// 合同正式送签
		const SUBMIT_CONTRACT = 8;
		// 合同借阅
		const SUBMIT_CONTRACT_LENDING = 9;
		// 合同借阅续期审批
		const SUBMIT_CONTRACT_LENDING_TIME_ADD = 10;
        // 合同用印审批
		const SUBMIT_SEAL_CONTRACT = 11;


		# 信用项目审批第一节点信控专员审查
		#
		public const SUBMIT_CREDIT_PROJECT_CREDIT_MANAGER_REVIEW			= 11;
		
		# 信用项目审批第二节点财务专员审查
		#
		public const SUBMIT_CREDIT_PROJECT_CREDIT_FINANCE_MANAGER_REVIEW	= 12;

		# 信用项目审批第三节点部门领导审查
		#
		public const SUBMIT_CREDIT_PROJECT_CREDIT_DEPARTMENT_LEADER_REVIEW	= 13;

		# 信用项目审批已批准赊销项目额度的调增调减审查
		#
		public const SUBMIT_CREDIT_PROJECT_CREDIT_AMOUNT_ADJUST_REVIEW		= 14;

		/**
		 * 审批节点调用的case
		 * @param $consts
		 */
		public function getApprovalEntityByApprovalSubmitTypeConsts($consts)
		{
			switch ($consts)
			{
				case self::SUBMIT_CREDIT_CLIENT:
				{
					return new ApprovalCreditClient();
				}
                case self::SUBMIT_JOIN_BLACKLIST:{
                    return new ApprovalCreditClientJoinBlack();
                }
                case self::SUBMIT_REMOVE_BLACKLIST:
                {
                    return new ApprovalCreditClientRemoveBlack();
                }
                // 合同审批回调
                case self::SUBMIT_CONTRACT:
                {
                    return new ApprovalContract();
                }
                // 合同签署审批回调
                case self::SUBMIT_SEAL_CONTRACT:
                {
                    return new ApprovalSealContract();
                }
                case self::SUBMIT_CONTRACT_LAW:
                {
                    return new ApprovalFwContract();
                }

				# by breezeer
				#
				#
				case self::SUBMIT_CREDIT_PROJECT_CREDIT_MANAGER_REVIEW				:	{	return new ApprovalCreditProjectCreditManagerReview			()	;	}	# 信用项目审批第一节点信控专员审查
				case self::SUBMIT_CREDIT_PROJECT_CREDIT_FINANCE_MANAGER_REVIEW		:	{	return new ApprovalCreditProjectCreditFinanceManagerReview	()	;	}	# 信用项目审批第二节点财务专员审查
				case self::SUBMIT_CREDIT_PROJECT_CREDIT_DEPARTMENT_LEADER_REVIEW	:	{	return new ApprovalCreditProjectCreditDepartmentLeaderReview()	;	}	# 信用项目审批第三节点部门领导审查
				case self::SUBMIT_CREDIT_PROJECT_CREDIT_AMOUNT_ADJUST_REVIEW		:	{	return new ApprovalCreditProjectCreditAmountAjustReviw		()	;	}	# 信用项目审批已批准赊销项目额度的调增调减审查
			}
		}
	}